<?php
/**
 * logs.inc.php
 */

if(!defined('IN_SITE') || !defined('IN_ADMIN')) {
	exit('Access Denied');
}

require_once SITE_ROOT.'./admin/tongji.cfg.php';
$query = $db->query("SELECT id,name FROM {$tablepre}admin");
while ($row = $db->fetch_array($query, MYSQL_NUM)) {
		$userlist[] = $row;
	}
$selectusers = selectradio('user', 'user', $userlist, $user, 'select');
$date = $dateline ? s_htmlspecialchars($dateline) : date("Y-m-d",$timestamp);
$user = $user ? s_htmlspecialchars($user) : '';
$whereuser = $user ? "AND id='$user'" : "";
$work = $db->fetch_all("SELECT * FROM {$tablepre}tongji WHERE dateline='$date' {$whereuser}");
$showtable = $tableclass = '';
foreach($work as $k => $v) {
	if($k%2 == 0) {$tableclass = ' class="trbgcolor";';} else {$tableclass = '';}
	$showtable .= "<tr$tableclass>";
	$showtable .= '<td class="smalltxt" style="text-align: center;">'.$v[name].'</td><td class="smalltxt" style="text-align: center;">'.$v[dateline].'</td><td class="smalltxt" style="text-align: center;">'.$tjtype[$v[type]].'</td><td class="smalltxt" style="text-align: center;">'.$v[num].'</td></tr>';
}
include admin_tpl("work");
?>